Skip to content

Block eviction completion while Placement usage remains - #389

Merged
fwiesel merged 1 commit into
mainfrom
placement-eviction-guard
Nov 16, 2026
Merged

fwiesel merged 1 commit into
mainfrom
placement-eviction-guard

Conversation

@fwiesel

@fwiesel fwiesel commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

The eviction controller could report completion as soon as the hypervisor's server list was empty. A source live-migration or resize reservation can remain in Placement until finalization, so the source agent could be removed too early.

Check the host's Placement usage before setting Evicting=False. Keep the eviction running while any usage remains, and fail closed when Placement cannot be queried. The existing infinite ConfirmResize retry is unchanged.

Tests cover the usage check and the eviction guard.

@fwiesel
fwiesel force-pushed the placement-eviction-guard branch 5 times, most recently from 156f90b to a11f58a Compare November 11, 2026 13:48
@fwiesel fwiesel mentioned this pull request Nov 11, 2026
@fwiesel
fwiesel force-pushed the placement-eviction-guard branch from a11f58a to 752bfd5 Compare November 11, 2026 13:55
@fwiesel
fwiesel changed the base branch from main to run-go-makefile-maker-20261111 November 11, 2026 13:55
@fwiesel
fwiesel force-pushed the placement-eviction-guard branch from 752bfd5 to 563a347 Compare November 13, 2026 10:00
@fwiesel
fwiesel changed the base branch from run-go-makefile-maker-20261111 to main November 13, 2026 10:01
The hypervisor server list can be empty before the source agent has
finished a migration. Check the host's Placement usage and keep
Evicting=True while any usage remains.

Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
@fwiesel
fwiesel force-pushed the placement-eviction-guard branch from 563a347 to 22e8032 Compare November 13, 2026 16:30
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/eviction 66.34% (-1.53%) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack 73.89% (+0.97%) 👍
Coverage details

Compared to commit cfee313 (run #43438290245)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/eviction/controller.go 66.34% (-1.53%) 205 (+12) 136 (+5) 69 (+7) 👎
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack/placement.go 92.98% (-0.50%) 57 (+11) 53 (+10) 4 (+1) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files:

  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/eviction/controller_test.go
  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack/placement_test.go

@fwiesel
fwiesel marked this pull request as ready for review November 16, 2026 08:47
@fwiesel
fwiesel merged commit bfa755a into main Nov 16, 2026
10 checks passed
@fwiesel
fwiesel deleted the placement-eviction-guard branch November 16, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants